package read_input;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

import model.Data;

/**
 * this class prints the result of the algorithm
 * @author Orit
 *
 */

public class Result {
	PrintWriter writer;
	
	/**
	 * Default C'tor for Result
	 */
	public Result() {
		try {
			//create print writer for output.txt
			writer = new PrintWriter(new FileWriter(Data.get().getBuyfile()),false); 
		} catch (IOException e) {
			System.err.println("Error. can't create output.txt");
			return;
		}
	}
	
	public void writeTofile(String data){
		writer.println(data); 
	}
	
	public void closeFile(){
		writer.flush();
		writer.close();
	}

}
